export*from"redux";import{produce as Vo,current as _o,freeze as Lo,original as Uo,isDraft as Wo}from"immer";import{createSelector as Go,createSelectorCreator as Bo,lruMemoize as Ko,weakMapMemoize as Ho}from"reselect";import{current as it,isDraft as st}from"immer";import{createSelectorCreator as ct,weakMapMemoize as dt}from"reselect";var Re=(...e)=>{let t=ct(...e),r=Object.assign((...n)=>{let o=t(...n),a=(s,...p)=>o(st(s)?it(s):s,...p);return Object.assign(a,o),a},{withTypes:()=>r});return r},ie=Re(dt);import{applyMiddleware as Rt,createStore as Et,compose as wt,combineReducers as Pt,isPlainObject as Mt}from"redux";import{compose as Ee}from"redux";var we=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ee:Ee.apply(null,arguments)},Pn=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};import{thunk as St,withExtraArgument as gt}from"redux-thunk";import{isAction as Pe}from"redux";var q=e=>e&&typeof e.match=="function";function w(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(m(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Pe(n)&&n.type===e,r}function se(e){return typeof e=="function"&&"type"in e&&q(e)}function ce(e){return Pe(e)&&Object.keys(e).every(ut)}function ut(e){return["type","payload","error","meta"].indexOf(e)>-1}function lt(e){let t=e?`${e}`.split("/"):[],r=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. 
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${r}())\` instead of \`dispatch(${r})\`. This is necessary even if the action has no payload.`}function pt(e={}){return()=>r=>n=>r(n)}import{produce as ft,isDraftable as yt}from"immer";function W(e,t){for(let r of e)if(t(r))return r}var F=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function de(e){return yt(e)?ft(e,()=>{}):e}function V(e,t,r){if(e.has(t)){let o=e.get(t);return r.update&&(o=r.update(o,t,e),e.set(t,o)),o}if(!r.insert)throw new Error(m(10));let n=r.insert(t,e);return e.set(t,n),n}function ht(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function At(e={}){if(1)return()=>n=>o=>n(o);var t,r}import{isPlainObject as Tt}from"redux";function Me(e){let t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||Tt(e)}function be(e,t="",r=Me,n,o=[],a){let s;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||a?.has(e))return!1;let p=n!=null?n(e):Object.entries(e),c=o.length>0;for(let[A,i]of p){let u=t?t+"."+A:A;if(!(c&&o.some(g=>g instanceof RegExp?g.test(u):u===g))){if(!r(i))return{keyPath:u,value:i};if(typeof i=="object"&&(s=be(i,u,r,n,o,a),s))return s}}return a&&Ie(e)&&a.add(e),!1}function Ie(e){if(!Object.isFrozen(e))return!1;for(let t of Object.values(e))if(!(typeof t!="object"||t===null)&&!Ie(t))return!1;return!0}function mt(e={}){return()=>t=>r=>t(r)}function kt(e){return typeof e=="boolean"}var ve=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},s=new F;return r&&(kt(r)?s.push(St):s.push(gt(r.extraArgument))),s};var ue="RTK_autoBatch",xt=()=>e=>({payload:e,meta:{[ue]:!0}}),De=e=>t=>{setTimeout(t,e)},Ct=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:De(10),le=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,s=!1,p=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?Ct:e.type==="callback"?e.queueNotification:De(e.timeout),A=()=>{s=!1,a&&(a=!1,p.forEach(i=>i()))};return Object.assign({},n,{subscribe(i){let u=()=>o&&i(),y=n.subscribe(u);return p.add(i),()=>{y(),p.delete(i)}},dispatch(i){try{return o=!i?.meta?.[ue],a=!o,a&&(s||(s=!0,c(A))),n.dispatch(i)}finally{o=!0}}})};var Oe=e=>function(r){let{autoBatch:n=!0}=r??{},o=new F(e);return n&&o.push(le(typeof n=="object"?n:void 0)),o};var v=!0;function bt(e){let t=ve(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Mt(r))p=Pt(r);else throw new Error(m(1));if(!v&&n&&typeof n!="function")throw new Error(m(2));let c;if(typeof n=="function"){if(c=n(t),!v&&!Array.isArray(c))throw new Error(m(3))}else c=t();if(!v&&c.some(l=>typeof l!="function"))throw new Error(m(4));let A=wt;o&&(A=we({trace:!v,...typeof o=="object"&&o}));let i=Rt(...c),u=Oe(i);if(!v&&s&&typeof s!="function")throw new Error(m(5));let y=typeof s=="function"?s(u):u();if(!v&&!Array.isArray(y))throw new Error(m(6));if(!v&&y.some(l=>typeof l!="function"))throw new Error(m(7));!v&&c.length&&!y.includes(i)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");let g=A(...y);return Et(p,a,g)}import{produce as It,isDraft as vt,isDraftable as Dt}from"immer";function $(e){let t={},r=[],n,o={addCase(a,s){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(m(28));if(p in t)throw new Error(m(29));return t[p]=s,o},addMatcher(a,s){return r.push({matcher:a,reducer:s}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function Ot(e){return typeof e=="function"}function pe(e,t){let[r,n,o]=$(t),a;if(Ot(e))a=()=>de(e());else{let p=de(e);a=()=>p}function s(p=a(),c){let A=[r[c.type],...n.filter(({matcher:i})=>i(c)).map(({reducer:i})=>i)];return A.filter(i=>!!i).length===0&&(A=[o]),A.reduce((i,u)=>{if(u)if(vt(i)){let g=u(i,c);return g===void 0?i:g}else{if(Dt(i))return It(i,y=>u(y,c));{let y=u(i,c);if(y===void 0){if(i===null)return i;throw new Error(m(9))}return y}}return i},p)}return s.getInitialState=a,s}var Nt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",P=(e=21)=>{let t="",r=e;for(;r--;)t+=Nt[Math.random()*64|0];return t};var Ne=(e,t)=>q(e)?e.match(t):e(t);function _(...e){return t=>e.some(r=>Ne(r,t))}function z(...e){return t=>e.every(r=>Ne(r,t))}function J(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function G(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function je(...e){return e.length===0?t=>J(t,["pending"]):G(e)?_(...e.map(t=>t.pending)):je()(e[0])}function X(...e){return e.length===0?t=>J(t,["rejected"]):G(e)?_(...e.map(t=>t.rejected)):X()(e[0])}function Fe(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?z(X(...e),t):G(e)?z(X(...e),t):Fe()(e[0])}function Ve(...e){return e.length===0?t=>J(t,["fulfilled"]):G(e)?_(...e.map(t=>t.fulfilled)):Ve()(e[0])}function _e(...e){return e.length===0?t=>J(t,["pending","fulfilled","rejected"]):G(e)?_(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):_e()(e[0])}var jt=["name","message","stack","code"],B=class{constructor(t,r){this.payload=t;this.meta=r}_type},Q=class{constructor(t,r){this.payload=t;this.meta=r}_type},Le=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of jt)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},fe=(()=>{function e(t,r,n){let o=w(t+"/fulfilled",(c,A,i,u)=>({payload:c,meta:{...u||{},arg:i,requestId:A,requestStatus:"fulfilled"}})),a=w(t+"/pending",(c,A,i)=>({payload:void 0,meta:{...i||{},arg:A,requestId:c,requestStatus:"pending"}})),s=w(t+"/rejected",(c,A,i,u,y)=>({payload:u,error:(n&&n.serializeError||Le)(c||"Rejected"),meta:{...y||{},arg:i,requestId:A,rejectedWithValue:!!u,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function p(c){return(A,i,u)=>{let y=n?.idGenerator?n.idGenerator(c):P(),g=new AbortController,l,h;function k(d){h=d,g.abort()}let f=async function(){let d;try{let S=n?.condition?.(c,{getState:i,extra:u});if(Ft(S)&&(S=await S),S===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let R=new Promise((x,C)=>{l=()=>{C({name:"AbortError",message:h||"Aborted"})},g.signal.addEventListener("abort",l)});A(a(y,c,n?.getPendingMeta?.({requestId:y,arg:c},{getState:i,extra:u}))),d=await Promise.race([R,Promise.resolve(r(c,{dispatch:A,getState:i,extra:u,requestId:y,signal:g.signal,abort:k,rejectWithValue:(x,C)=>new B(x,C),fulfillWithValue:(x,C)=>new Q(x,C)})).then(x=>{if(x instanceof B)throw x;return x instanceof Q?o(x.payload,y,c,x.meta):o(x,y,c)})])}catch(S){d=S instanceof B?s(null,y,c,S.payload,S.meta):s(S,y,c)}finally{l&&g.signal.removeEventListener("abort",l)}return n&&!n.dispatchConditionRejection&&s.match(d)&&d.meta.condition||A(d),d}();return Object.assign(f,{abort:k,requestId:y,arg:c,unwrap(){return f.then(Ue)}})}}return Object.assign(p,{pending:a,rejected:s,fulfilled:o,settled:_(s,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Ue(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Ft(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var We=Symbol.for("rtk-slice-createasyncthunk"),Vt={[We]:fe},ze=(n=>(n.reducer="reducer",n.reducerWithPrepare="reducerWithPrepare",n.asyncThunk="asyncThunk",n))(ze||{});function _t(e,t){return`${e}/${t}`}function Ge({creators:e}={}){let t=e?.asyncThunk?.[We];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(m(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(Wt()):n.reducers)||{},p=Object.keys(s),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},A={addCase(d,T){let S=typeof d=="string"?d:d.type;if(!S)throw new Error(m(12));if(S in c.sliceCaseReducersByType)throw new Error(m(13));return c.sliceCaseReducersByType[S]=T,A},addMatcher(d,T){return c.sliceMatchers.push({matcher:d,reducer:T}),A},exposeAction(d,T){return c.actionCreators[d]=T,A},exposeCaseReducer(d,T){return c.sliceCaseReducersByName[d]=T,A}};p.forEach(d=>{let T=s[d],S={reducerName:d,type:_t(o,d),createNotation:typeof n.reducers=="function"};Gt(T)?Kt(S,T,A,t):zt(S,T,A)});function i(){let[d={},T=[],S=void 0]=typeof n.extraReducers=="function"?$(n.extraReducers):[n.extraReducers],R={...d,...c.sliceCaseReducersByType};return pe(n.initialState,x=>{for(let C in R)x.addCase(C,R[C]);for(let C of c.sliceMatchers)x.addMatcher(C.matcher,C.reducer);for(let C of T)x.addMatcher(C.matcher,C.reducer);S&&x.addDefaultCase(S)})}let u=d=>d,y=new Map,g;function l(d,T){return g||(g=i()),g(d,T)}function h(){return g||(g=i()),g.getInitialState()}function k(d,T=!1){function S(x){let C=x[d];return typeof C>"u"&&T&&(C=h()),C}function R(x=u){let C=V(y,T,{insert:()=>new WeakMap});return V(C,x,{insert:()=>{let j={};for(let[I,H]of Object.entries(n.selectors??{}))j[I]=Lt(H,x,h,T);return j}})}return{reducerPath:d,getSelectors:R,get selectors(){return R(S)},selectSlice:S}}let f={name:o,reducer:l,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:h,...k(a),injectInto(d,{reducerPath:T,...S}={}){let R=T??a;return d.inject({reducerPath:R,reducer:l},S),{...f,...k(R,!0)}}};return f}}function Lt(e,t,r,n){function o(a,...s){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...s)}return o.unwrapped=e,o}var Ut=Ge();function Wt(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function zt({type:e,reducerName:t,createNotation:r},n,o){let a,s;if("reducer"in n){if(r&&!Bt(n))throw new Error(m(17));a=n.reducer,s=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?w(e,s):w(e))}function Gt(e){return e._reducerDefinitionType==="asyncThunk"}function Bt(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Kt({type:e,reducerName:t},r,n,o){if(!o)throw new Error(m(18));let{payloadCreator:a,fulfilled:s,pending:p,rejected:c,settled:A,options:i}=r,u=o(e,a,i);n.exposeAction(t,u),s&&n.addCase(u.fulfilled,s),p&&n.addCase(u.pending,p),c&&n.addCase(u.rejected,c),A&&n.addMatcher(u.settled,A),n.exposeCaseReducer(t,{fulfilled:s||Y,pending:p||Y,rejected:c||Y,settled:A||Y})}function Y(){}function Ht(){return{ids:[],entities:{}}}function Be(e){function t(r={},n){let o=Object.assign(Ht(),r);return n?e.setAll(o,n):o}return{getInitialState:t}}function Ke(){function e(t,r={}){let{createSelector:n=ie}=r,o=u=>u.ids,a=u=>u.entities,s=n(o,a,(u,y)=>u.map(g=>y[g])),p=(u,y)=>y,c=(u,y)=>u[y],A=n(o,u=>u.length);if(!t)return{selectIds:o,selectEntities:a,selectAll:s,selectTotal:A,selectById:n(a,p,c)};let i=n(t,a);return{selectIds:n(t,o),selectEntities:i,selectAll:n(t,s),selectTotal:n(t,A),selectById:n(i,p,c)}}return{getSelectors:e}}import{current as Qt}from"immer";import{produce as qt,isDraft as $t}from"immer";var Xt=$t;function He(e){let t=E((r,n)=>e(n));return function(n){return t(n,void 0)}}function E(e){return function(r,n){function o(s){return ce(s)}let a=s=>{o(n)?e(n.payload,s):e(n,s)};return Xt(r)?(a(r),r):qt(r,a)}}import{current as qe,isDraft as Jt}from"immer";function D(e,t){return t(e)}function b(e){return Array.isArray(e)||(e=Object.values(e)),e}function ye(e){return Jt(e)?qe(e):e}function Z(e,t,r){e=b(e);let n=qe(r.ids),o=new Set(n),a=[],s=[];for(let p of e){let c=D(p,t);o.has(c)?s.push({id:c,changes:p}):a.push(p)}return[a,s,n]}function ee(e){function t(l,h){let k=D(l,e);k in h.entities||(h.ids.push(k),h.entities[k]=l)}function r(l,h){l=b(l);for(let k of l)t(k,h)}function n(l,h){let k=D(l,e);k in h.entities||h.ids.push(k),h.entities[k]=l}function o(l,h){l=b(l);for(let k of l)n(k,h)}function a(l,h){l=b(l),h.ids=[],h.entities={},r(l,h)}function s(l,h){return p([l],h)}function p(l,h){let k=!1;l.forEach(f=>{f in h.entities&&(delete h.entities[f],k=!0)}),k&&(h.ids=h.ids.filter(f=>f in h.entities))}function c(l){Object.assign(l,{ids:[],entities:{}})}function A(l,h,k){let f=k.entities[h.id];if(f===void 0)return!1;let d=Object.assign({},f,h.changes),T=D(d,e),S=T!==h.id;return S&&(l[h.id]=T,delete k.entities[h.id]),k.entities[T]=d,S}function i(l,h){return u([l],h)}function u(l,h){let k={},f={};l.forEach(T=>{T.id in h.entities&&(f[T.id]={id:T.id,changes:{...f[T.id]?f[T.id].changes:null,...T.changes}})}),l=Object.values(f),l.length>0&&l.filter(S=>A(k,S,h)).length>0&&(h.ids=Object.values(h.entities).map(S=>D(S,e)))}function y(l,h){return g([l],h)}function g(l,h){let[k,f]=Z(l,e,h);u(f,h),r(k,h)}return{removeAll:He(c),addOne:E(t),addMany:E(r),setOne:E(n),setMany:E(o),setAll:E(a),updateOne:E(i),updateMany:E(u),upsertOne:E(y),upsertMany:E(g),removeOne:E(s),removeMany:E(p)}}function Yt(e,t,r){let n=0,o=e.length;for(;n<o;){let a=n+o>>>1,s=e[a];r(t,s)>=0?n=a+1:o=a}return n}function Zt(e,t,r){let n=Yt(e,t,r);return e.splice(n,0,t),e}function $e(e,t){let{removeOne:r,removeMany:n,removeAll:o}=ee(e);function a(f,d){return s([f],d)}function s(f,d,T){f=b(f);let S=new Set(T??Qt(d.ids)),R=f.filter(x=>!S.has(D(x,e)));R.length!==0&&k(d,R)}function p(f,d){return c([f],d)}function c(f,d){if(f=b(f),f.length!==0){for(let T of f)delete d.entities[e(T)];k(d,f)}}function A(f,d){f=b(f),d.entities={},d.ids=[],s(f,d,[])}function i(f,d){return u([f],d)}function u(f,d){let T=!1,S=!1;for(let R of f){let x=d.entities[R.id];if(!x)continue;T=!0,Object.assign(x,R.changes);let C=e(x);if(R.id!==C){S=!0,delete d.entities[R.id];let j=d.ids.indexOf(R.id);d.ids[j]=C,d.entities[C]=x}}T&&k(d,[],T,S)}function y(f,d){return g([f],d)}function g(f,d){let[T,S,R]=Z(f,e,d);S.length&&u(S,d),T.length&&s(T,d,R)}function l(f,d){if(f.length!==d.length)return!1;for(let T=0;T<f.length&&T<d.length;T++)if(f[T]!==d[T])return!1;return!0}let k=(f,d,T,S)=>{let R=ye(f.entities),x=ye(f.ids),C=f.entities,j=x;S&&(j=Array.from(new Set(x)));let I=[];for(let U of j){let Ce=R[U];Ce&&I.push(Ce)}let H=I.length===0;for(let U of d)C[e(U)]=U,H||Zt(I,U,t);H?I=d.slice().sort(t):T&&I.sort(t);let xe=I.map(e);l(x,xe)||(f.ids=xe)};return{removeOne:r,removeMany:n,removeAll:o,addOne:E(a),updateOne:E(i),upsertOne:E(y),setOne:E(p),setMany:E(c),setAll:E(A),addMany:E(s),updateMany:E(u),upsertMany:E(g)}}function en(e={}){let{selectId:t,sortComparer:r}={sortComparer:!1,selectId:s=>s.id,...e},n=r?$e(t,r):ee(t),o=Be(n),a=Ke();return{selectId:t,sortComparer:r,...o,...a,...n}}import{isAction as nn}from"redux";var tn="task",Xe="listener",Je="completed",he="cancelled",Qe=`task-${he}`,Ye=`task-${Je}`,te=`${Xe}-${he}`,Ze=`${Xe}-${Je}`,M=class{constructor(t){this.code=t;this.message=`${tn} ${he} (reason: ${t})`}name="TaskAbortError";message};var ne=(e,t)=>{if(typeof e!="function")throw new Error(m(32))},L=()=>{},re=(e,t=L)=>(e.catch(t),e),oe=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),O=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))};var N=e=>{if(e.aborted){let{reason:t}=e;throw new M(t)}};function Ae(e,t){let r=L;return new Promise((n,o)=>{let a=()=>o(new M(e.reason));if(e.aborted){a();return}r=oe(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=L})}var et=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof M?"cancelled":"rejected",error:r}}finally{t?.()}},K=e=>t=>re(Ae(e,t).then(r=>(N(e),r))),Te=e=>{let t=K(e);return r=>t(new Promise(n=>setTimeout(n,r)))};var{assign:rn}=Object,tt={},ae="listenerMiddleware",on=(e,t)=>{let r=n=>oe(e,()=>O(n,e.reason));return(n,o)=>{ne(n,"taskExecutor");let a=new AbortController;r(a);let s=et(async()=>{N(e),N(a.signal);let p=await n({pause:K(a.signal),delay:Te(a.signal),signal:a.signal});return N(a.signal),p},()=>O(a,Ye));return o?.autoJoin&&t.push(s.catch(L)),{result:K(e)(s),cancel(){O(a,Qe)}}}},an=(e,t)=>{let r=async(n,o)=>{N(t);let a=()=>{},p=[new Promise((c,A)=>{let i=e({predicate:n,effect:(u,y)=>{y.unsubscribe(),c([u,y.getState(),y.getOriginalState()])}});a=()=>{i(),A()}})];o!=null&&p.push(new Promise(c=>setTimeout(c,o,null)));try{let c=await Ae(t,Promise.race(p));return N(t),c}finally{a()}};return(n,o)=>re(r(n,o))},rt=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=w(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(m(21));return ne(a,"options.listener"),{predicate:o,type:t,effect:a}},ot=Object.assign(e=>{let{type:t,predicate:r,effect:n}=rt(e);return{id:P(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(m(22))}}},{withTypes:()=>ot}),me=e=>{e.pending.forEach(t=>{O(t,te)})},sn=e=>()=>{e.forEach(me),e.clear()},nt=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Se=Object.assign(w(`${ae}/add`),{withTypes:()=>Se}),at=w(`${ae}/removeAll`),ge=Object.assign(w(`${ae}/remove`),{withTypes:()=>ge}),cn=(...e)=>{console.error(`${ae}/error`,...e)},dn=(e={})=>{let t=new Map,{extra:r,onError:n=cn}=e;ne(n,"onError");let o=i=>(i.unsubscribe=()=>t.delete(i.id),t.set(i.id,i),u=>{i.unsubscribe(),u?.cancelActive&&me(i)}),a=i=>{let u=W(Array.from(t.values()),y=>y.effect===i.effect);return u||(u=ot(i)),o(u)};Object.assign(a,{withTypes:()=>a});let s=i=>{let{type:u,effect:y,predicate:g}=rt(i),l=W(Array.from(t.values()),h=>(typeof u=="string"?h.type===u:h.predicate===g)&&h.effect===y);return l&&(l.unsubscribe(),i.cancelActive&&me(l)),!!l};Object.assign(s,{withTypes:()=>s});let p=async(i,u,y,g)=>{let l=new AbortController,h=an(a,l.signal),k=[];try{i.pending.add(l),await Promise.resolve(i.effect(u,rn({},y,{getOriginalState:g,condition:(f,d)=>h(f,d).then(Boolean),take:h,delay:Te(l.signal),pause:K(l.signal),extra:r,signal:l.signal,fork:on(l.signal,k),unsubscribe:i.unsubscribe,subscribe:()=>{t.set(i.id,i)},cancelActiveListeners:()=>{i.pending.forEach((f,d,T)=>{f!==l&&(O(f,te),T.delete(f))})},cancel:()=>{O(l,te),i.pending.delete(l)},throwIfCancelled:()=>{N(l.signal)}})))}catch(f){f instanceof M||nt(n,f,{raisedBy:"effect"})}finally{await Promise.all(k),O(l,Ze),i.pending.delete(l)}},c=sn(t);return{middleware:i=>u=>y=>{if(!nn(y))return u(y);if(Se.match(y))return a(y.payload);if(at.match(y)){c();return}if(ge.match(y))return s(y.payload);let g=i.getState(),l=()=>{if(g===tt)throw new Error(m(23));return g},h;try{if(h=u(y),t.size>0){let k=i.getState(),f=Array.from(t.values());for(let d of f){let T=!1;try{T=d.predicate(y,k,g)}catch(S){T=!1,nt(n,S,{raisedBy:"predicate"})}T&&p(d,y,i,l)}}}finally{g=tt}return h},startListening:a,stopListening:s,clearListeners:c}};import{compose as un}from"redux";var ln=e=>({id:P(),middleware:e,applied:new Map}),pn=e=>t=>t?.meta?.instanceId===e,fn=()=>{let e=P(),t=new Map,r=Object.assign(w("dynamicMiddleware/add",(...p)=>({payload:p,meta:{instanceId:e}})),{withTypes:()=>r}),n=Object.assign(function(...c){c.forEach(A=>{let i=W(Array.from(t.values()),u=>u.middleware===A);i||(i=ln(A)),t.set(i.id,i)})},{withTypes:()=>n}),o=p=>{let c=Array.from(t.values()).map(A=>V(A.applied,p,{insert:()=>A.middleware(p)}));return un(...c)},a=z(r,pn(e));return{middleware:p=>c=>A=>a(A)?(n(...A.payload),p.dispatch):o(p)(c)(A),addMiddleware:n,withMiddleware:r,instanceId:e}};import{combineReducers as yn}from"redux";var hn=e=>"reducerPath"in e&&typeof e.reducerPath=="string",An=e=>e.flatMap(t=>hn(t)?[[t.reducerPath,t.reducer]]:Object.entries(t)),ke=Symbol.for("rtk-state-proxy-original"),Tn=e=>!!e&&!!e[ke],mn=new WeakMap,Sn=(e,t)=>V(mn,e,{insert:()=>new Proxy(e,{get:(r,n,o)=>{if(n===ke)return r;let a=Reflect.get(r,n,o);if(typeof a>"u"){let s=t[n.toString()];if(s){let p=s(void 0,{type:P()});if(typeof p>"u")throw new Error(m(24));return p}}return a}})}),gn=e=>{if(!Tn(e))throw new Error(m(25));return e[ke]},kn=(e={})=>e;function xn(...e){let t=Object.fromEntries(An(e)),r=()=>Object.keys(t).length?yn(t):kn,n=r();function o(p,c){return n(p,c)}o.withLazyLoadedSlices=()=>o;let a=(p,c={})=>{let{reducerPath:A,reducer:i}=p,u=t[A];return!c.overrideExisting&&u&&u!==i?(typeof process<"u",o):(t[A]=i,n=r(),o)},s=Object.assign(function(c,A){return function(u,...y){return c(Sn(A?A(u,...y):u,t),...y)}},{original:gn});return Object.assign(o,{inject:a,selector:s})}function m(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}export{ze as ReducerType,ue as SHOULD_AUTOBATCH,M as TaskAbortError,F as Tuple,Se as addListener,Vt as asyncThunkCreator,le as autoBatchEnhancer,Ge as buildCreateSlice,at as clearAllListeners,xn as combineSlices,bt as configureStore,w as createAction,pt as createActionCreatorInvariantMiddleware,fe as createAsyncThunk,ie as createDraftSafeSelector,Re as createDraftSafeSelectorCreator,fn as createDynamicMiddleware,en as createEntityAdapter,At as createImmutableStateInvariantMiddleware,dn as createListenerMiddleware,Vo as createNextState,pe as createReducer,Go as createSelector,Bo as createSelectorCreator,mt as createSerializableStateInvariantMiddleware,Ut as createSlice,_o as current,be as findNonSerializableValue,m as formatProdErrorMessage,Lo as freeze,se as isActionCreator,z as isAllOf,_ as isAnyOf,_e as isAsyncThunkAction,Wo as isDraft,ce as isFluxStandardAction,Ve as isFulfilled,ht as isImmutableDefault,je as isPending,Me as isPlain,X as isRejected,Fe as isRejectedWithValue,Ko as lruMemoize,Le as miniSerializeError,P as nanoid,Uo as original,xt as prepareAutoBatched,ge as removeListener,Ue as unwrapResult,Ho as weakMapMemoize};
//# sourceMappingURL=redux-toolkit.browser.mjs.map